<!DOCTYPE html>
<html>

<head>
  <title></title>
</head>
<!-- <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script> -->

<body>

  <table>
    <tr>
      <td style="width: 200px; vertical-align: top">
        <ul id="chapters">
          <li><a href="./1.html">第1章</a></li>
          <li><a href="./2.html">第2章</a></li>
          <li><a href="./3.html">第3章</a></li>
          <li><a href="./4.html">第4章</a></li>
        </ul>
      </td>
      <td style="width: 80%" id="content"></td>
    </tr>
  </table>
  <script src="getResponse.js"></script>
  <script>
    // 你的代码
    document.getElementById('chapters').onclick = (e) => {
      // console.log(e.target);
      if (e.target.tagName === 'A') {
        e.preventDefault()
        const url = e.target.href
        getResponse(url).then((text) => {
          document.getElementById('content').innerHTML = text
        })
      }
    }
  </script>
</body>

</html>